class AdminController {
	def login = {
   		if (request.method == "GET") {
       			session.adminId = null
       			def admin = new Admin()
   		}
   		else {
       			def admin = Admin.findByAdminIdAndPassword(params.adminId,params.password)
       			if (admin) {
          			session.adminId = admin.adminId
          			redirect(controller:'partMemberInfo')
       			}
       			else {
          			flash['message'] = '请输入合法的管理员Id和密码'
					redirect(uri:'/index.gsp')
       			}
   		}
	}

	def logout = {
   		session.adminId = null
   		flash['message'] = '成功退出'
   		redirect(uri:'/index.gsp')
	}
}
